package com.zrrd.day0801;

public class ArrTest01 {
    public static void main(String[] args) {
        int[] array = {1, 3, 5, 7, 9, 11, 13, 15, 17, 0};
        int goal = 9;
        int newNum = 10;

        int index = -1;
        for (int i = 0; i < goal; i++) {
            if (array[i] == 9) {
                index = i;
                break;
            }
        }

        if (index != -1) {
            for (int i = goal; i > index + 1; i--) {
                array[i] = array[i - 1];
            }
            array[index + 1] = newNum;
            goal++;
        }

        for (int i = 0; i < goal; i++) {
            System.out.print(array[i] + " ");
        }
    }
}
